function p=init(p)
    p.padding = 1;
    p.hog_cell_size = 4;
    p.lambda = 1e-3;
    p.output_sigma_factor = 1/16;
    
    p.learning_rate_cf = 0.01;
    p.learning_rate_hist = 0.04;
    p.learning_rate_scale = 0.015;
    p.fixed_area = 150^2;
    
    avg_dim = sum(p.target_sz)/2;
    % Size of search window during training and detection
    p.window_sz = round(p.target_sz + p.padding*avg_dim);
    p.scale_sz = round(p.target_sz + avg_dim/2.5);
    p.norm_scale_sz = [128,128];
    p.mag =p.norm_scale_sz(1)/log(sqrt(sum(p.norm_scale_sz.^2)/4));
    % p.window_sz = p.window_sz - mod(p.window_sz - p.target_sz, 2);
    p.sc = sqrt(prod(p.window_sz) / p.fixed_area);
    p.norm_window_sz = round(p.window_sz * p.sc);
    p.norm_target_sz = round(p.target_sz * p.sc);
    p.response_sz = floor(p.norm_window_sz / p.hog_cell_size);
    p.output_sigma = sqrt(prod(p.norm_target_sz)) * p.output_sigma_factor / p.hog_cell_size;
    p.cos_window = single(hann(p.response_sz(1)) * hann(p.response_sz(2))');
    p.y = gaussian_shaped_labels(p.output_sigma, p.response_sz);
    p.yf = fft2(p.y);
    p.rot = 0;
    
    norm_pad = floor((p.norm_window_sz - p.norm_target_sz) / 2);
	radius = min(norm_pad);
	p.norm_delta_sz = (2*radius+1) * [1, 1];
    p.norm_likelihood_sz = p.norm_target_sz + p.norm_delta_sz - 1;
    p.visualization = 1;
end